//
//  CityCollectionCell.m
//  Lovely Food
//
//  Created by 李经纬 on 15/12/8.
//  Copyright © 2015年 李经纬. All rights reserved.
//


#import "CityCollectionCell.h"

@implementation CityCollectionCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
    }
    return self;
}

-(void)setupView
{
    self.cityImage = [[UIImageView alloc]init];
    self.cityImage.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.cityImage];
    
    self.cityName = [[UILabel alloc]init];
    self.cityName.backgroundColor = [UIColor yellowColor];
    self.cityName.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.cityName];
}

-(void)layoutSubviews
{
    self.cityImage.frame = CGRectMake(0, 0, CGRectGetWidth(self.contentView.frame), self.contentView.frame.size.width);
    self.cityName.frame = CGRectMake(CGRectGetMinX(self.cityImage.frame), CGRectGetMaxY(self.cityImage.frame), CGRectGetWidth(self.cityImage.frame), self.contentView.frame.size.height - self.contentView.frame.size.width);
    
    
}
@end


